<extend name="Base/agent"/>
<block name="content">
	<!--主体内容-->
	<div class="admin-main">
		<p class="current-title">我的资金</p>
		<p class="current-park"><i class="icon icon-index"></i><a href="{:U('AgentIndex/index')}" class="current-index">首页</a> 〉〉 我的资金</p>
		<!--数据表格-->
		<div class="main-table-data" style = "height:100%;">
			<p class="table-title">我的资金</p>
			<table class="current-table" >
				<tr>
					<th>会员名称</th>
					<th>开户银行卡用户名</th>
					<th>开户银行卡卡号</th>
					<th>开户银行卡证件号</th>
					<th>账户余额</th>
					<th>下级余额</th>
					<th>保证金</th>
					<th>坐市比例</th>
				</tr>
			<foreach name="list" item="vo">
				<tr class="table-nobg">
					<td>{$vo.nickname}</td>
					<td>{$vo.bank_realname}</td>
					<td>{$vo.bank_card}</td>
					<td>{$vo.id_card}</td>
					<td>{$vo.money}  元</td>
					<td>{$sub_money}  元</td>
					<td>{:session('AGENT.sure_money')}  元</td>
					<td>{:session('AGENT.market')}</td>
				</tr>
			</foreach>
			</table>
			<!-- 搜索 -->
			<div class="current-condition" style = "margin-bottom:0px;">
				<input type="text" name="start_time" value="{:I('start_time')}" class="current-stardate" placeholder="起始时间" style = "margin-bottom:0px;"/>
				<span style = "margin-left:-15px">至</span>
				<input type="text" name="end_time" value="{:I('end_time')}" class="current-stardate" placeholder="结束时间" style = "margin-bottom:0px;"/>
				<input type="button" href="javascript:;" id="search" url="{:U('index')}" value="搜索" class="current-serach"/>
			</div>
			<p class="table-title" style = "margin-top:0px">收益亏损</p>
			<table class="current-table" >
				<tr>
					<th>订单类型</th>
					<th>订单金额</th>
					<th>用户盈利</th>
					<th>用户亏损</th>
					<th>公司收入</th>
				</tr>
				<foreach name="profit" item="vo" key = "key">
				<tr class="table-nobg">
					<td>{$vo.title}</td>
					<td>{$vo.invest}  元</td>
					<td>{$vo.profit}  元</td>
					<td>{$vo.loss}  元</td>
					<td>{$vo.pal}  元</td>
				</tr>
				</foreach>
			</table>
			<p class="table-title" style = "margin-top:20px">出入金</p>
			<table class="current-table" >
				<tr>
					<th>金额类型</th>
					<th>出入金额</th>
					<th>手续费</th>
				</tr>
				<foreach name="gold" item="vo" key = "key">
				<tr class="table-nobg">
					<td>{$vo.title}</td>
					<td>{$vo.money}  元</td>
					<td>{$vo.fee}  元</td>
				</tr>
				</foreach>
			</table>
			<p class="table-title" style = "margin-top:20px">佣金</p>
			<table class="current-table" >
				<tr>
					<th>佣金状态</th>
					<th>金额</th>
				</tr>
				<foreach name="com_data" item="vo" key = "key">
				<tr class="table-nobg">
					<td>{$vo.title}</td>
					<td>{$vo.commission}  元</td>
				</tr>
				</foreach>
			</table>
		</div>
		<script type="text/javascript">
		//搜索功能
	    $("#search").click(function(){
	        var url = $(this).attr('url');
	        url = url.substr(0,url.lastIndexOf('.'));
	        var query  = $('.current-condition').find('input').serialize();
	        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
	        query = query.replace(/^&/g,'');
	        query = query.replace(/=/gm,"/");
	        query = query.replace(/&/gm,"/");
	        if( url.indexOf('?')>0 ){
	        	if(query.substr(0,1) != "/"){
	        		url += "/"+query;
	        	}else{
	        		url += query;
	        	}
	        }else{
	            url += "/" + query;
	        }
	        window.location.href = url;
	    });
	    </script>
	</div>
</block>
